package com.whately.core.base.config;

import lombok.Getter;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class ServiceMethod {


    Object bean;
    Method method;

    //是否忽略验证session
    @Getter
    boolean ignoreSessionFlag;

    //是否内部api
    @Getter
    boolean innerFlag;

    ServiceMethod(Object bean, Method method,boolean ignoreSessionFlag,boolean innerFlag) {
        this.bean = bean;
        this.method = method;
        this.ignoreSessionFlag = ignoreSessionFlag;
        this.innerFlag = innerFlag;
    }

    Object call(Object[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
        return method.invoke(bean, args);
    }
}
